﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Text;
using System.Data.SqlClient;


namespace zlh.Studentyemian
{
    public partial class stubanjibaocuo : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }
        protected void Page_PreInit(object sender, EventArgs e)
        {
            if (Session["color"] == "1")
            {
                Page.Theme = "1";

            }
            else if (Session["color"] == "2")
            {
                Page.Theme = "2";
            }
            else
            {
                Page.Theme = "3";
            }
        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            StringBuilder sb = new StringBuilder(1024);
            sb.Append("INSERT INTO banganmessage ");
            sb.Append("                (stuNO, stumessage, rightmessage) ");
            sb.Append("VALUES   (@stuNO, @stumessage, @rightmessage) ");

            SqlParameter[] pms = new SqlParameter[3];
            pms[0] = new SqlParameter("@stuNO", this.stuNo.Text);
            pms[1] = new SqlParameter("@stumessage", this.stumessage.Text);
            pms[2] = new SqlParameter("@rightmessage", this.rightmessage.Text);


            int intResult = (int)SqlHelper.ExecuteNonQuery(sb.ToString(), pms);
            this.lblInfo.Text = (intResult < 1) ? "新增失败！" : "新增" + intResult.ToString() + "条记录！";
        }
    }
}